@mixin clearfix {
  &::after {
    display: table;
    clear: both;
    content: '';
  }
}

@mixin ellipsis($line: 1) {
  overflow: hidden;
  text-overflow: ellipsis;

  @if $line > 1 {
    display: -webkit-box;
    -webkit-line-clamp: $line;
    -webkit-box-orient: vertical;
  } @else {
    white-space: nowrap;
  }
}

/* 图片在规定范围内显示 */
@mixin img-contain($width, $height) {
  width: $width;
  height: $height;
  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}
